package cn.zktr.Personnel.model.uitls;

import java.util.ArrayList;
import java.util.List;

import cn.zktr.Personnel.model.pojos.PerKnoWle;
import cn.zktr.Personnel.model.pojos.PerPmsEmp;

public class Wle {
	//姓名
	private String empname;
	//头像
	private String empimg;
	//未读数
	private int wlesum;
	//文本存放
	private List<Wle_text> wle_text;
	
	public Wle(PerPmsEmp ppe,Integer i) {
		List<Wle_text> list = new ArrayList<>();
		boolean y = true;
		int j = 0;
		for(PerKnoWle pkw : ppe.getPerKnoWles1()) {
			if(pkw.getPerPmsEmp2().getEmpid()==i) {
				setEmpname(pkw.getPerPmsEmp2().getEmpname());
				setEmpimg(pkw.getPerPmsEmp2().getPerPmsZts().get(0).getZthost());
				list.add(new Wle_text(pkw));
				if(y) {
					y = false;
					for(PerKnoWle  pkw2 : pkw.getPerPmsEmp2().getPerKnoWles1()){
						list.add(new Wle_text(pkw2));
						if(pkw2.getWlestat()==0) {
							j++;
						};
					}
				}
			}
		}
		setWlesum(j);
		setWle_text(list);
	}
	
	public String getEmpname() {
		return empname;
	}
	public void setEmpname(String empname) {
		this.empname = empname;
	}
	public String getEmpimg() {
		return empimg;
	}
	public void setEmpimg(String empimg) {
		this.empimg = empimg;
	}
	public int getWlesum() {
		return wlesum;
	}
	public void setWlesum(int wlesum) {
		this.wlesum = wlesum;
	}
	public List<Wle_text> getWle_text() {
		return wle_text;
	}
	public void setWle_text(List<Wle_text> wle_text) {
		this.wle_text = wle_text;
	}
}
